#ifndef _EXPRTYPE_H_
#define _EXPRTYPE_H_
#include "SimpleNode.h"
class IVisitor;
class exprType;
typedef QSharedPointer<exprType> exprTypePtr;

class exprType: public SimpleNode
{
public:
    explicit exprType(int nodeId=-1);
    virtual ~exprType();
    
    
    
    virtual QString type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
};



typedef QListIterator<exprTypePtr> ExprTypePtrListIterator;

class ExprTypeList: public QList<exprTypePtr>
{
public:
    inline ExprTypeList() { }
    inline explicit ExprTypeList(exprTypePtr i) { append(i); }
    inline ExprTypeList(const ExprTypeList &l) : QList<exprTypePtr>(l) { }
    inline ExprTypeList(const QList<exprTypePtr> &l) : QList<exprTypePtr>(l) { }

    inline ExprTypeList operator+(const ExprTypeList &other) const
    { ExprTypeList n = *this; n += other; return n; }
    inline ExprTypeList &operator<<(exprTypePtr it)
    { append(it); return *this; }
    inline ExprTypeList &operator<<(const ExprTypeList &l)
    { *this += l; return *this; }

    QString toString() const
    {
        QString str("ExprTypeList(");
        foreach(exprTypePtr it, *this){
            if (it != NULL){
                str += it->toString()+",";
            }
        }
        str += ")";
        return str;
    }

    void traverse(IVisitor* visitor)
    {
        foreach(exprTypePtr it, *this){
            if (it != NULL){
                it->accept(visitor, it);
            }
        }
    }
};



#endif